<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<script src="/js/jquery.min.js?v=2.1.4"></script>
<body class="gray-bg">
<div id="show1" style="display:true" >
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<input style="display: none" id="id" name="id" class="form-control" type="text" th:value="${pact.id}" >
														<div class="form-group" style="display:none">	
								<label class="col-sm-3 control-label">人员表ID：</label>
								<div class="col-sm-8">
									<input id="personnelId" name="personnelId" class="form-control" type="text" th:value="${pact.personnelId}" >
								</div>
							</div>
											
														<div class="form-group">	
								<label class="col-sm-3 control-label">姓名：</label>
								<div class="col-sm-8">
									<input id="name" name="name" class="form-control" type="text" readonly="readonly" th:value="${pact.name}">
								</div>
							</div>
											
														<div class="form-group">	
								<label class="col-sm-3 control-label">部门：</label>
								<div class="col-sm-8">
									<input id="department" name="department" class="form-control" readonly="readonly"  type="text" th:value="${pact.department}" >
								</div>
							</div>
								<div class="form-group">	
								<label class="col-sm-3 control-label">性别</label>
									<div class="col-sm-8">
									<label class="radio-inline">
										<input type="radio" name="sex" value="1" th:field="*{pact.sex}" /> 男
									</label>
									<label class="radio-inline">
										<input type="radio" name="sex" value="0" th:field="*{pact.sex}" /> 女
									</label>
								</div>
							</div>
							<div class="form-group">	
								<label class="col-sm-3 control-label">出生日期：</label>
								<div class="col-sm-8">
									<input id="dateBirth" name="dateBirth" readonly="readonly" class="form-control" type="text" th:field="*{pact.dateBirth}">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">职位：</label>
								<div class="col-sm-8">
									<input id="post" name="post" class="form-control" type="text" th:field="*{pact.post}">
								</div>
							</div>
										
							
									
							
							<div class="form-group">	
								<label class="col-sm-3 control-label">签订日期：</label>
								<div class="col-sm-8">
									<input id="dateSigning" name="dateSigning" readonly class="laydate-icon layer-date form-control" type="text">
								</div>
							</div>
										<div class="form-group">	
								<label class="col-sm-3 control-label">试用期日期：</label>
								<div class="col-sm-8">
									<input id="probationPeriod" name="probationPeriod" readonly class="laydate-icon layer-date form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">合同到期日期：</label>
								<div class="col-sm-8">
									<input id="expirationTime" name="expirationTime" readonly class="laydate-icon layer-date form-control" type="text">
								</div>
							</div>
												
													<!-- 	<div class="form-group">	
								<label class="col-sm-3 control-label">合同到期具体时间：</label>
								<div class="col-sm-8">
									<input id="expirationDate" name="expirationDate" class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">试用期到期具体时间：</label>
								<div class="col-sm-8">
									<input id="probationDate" name="probationDate" class="form-control" type="text">
								</div>
							</div> -->
													<!-- 	<div class="form-group">	
								<label class="col-sm-3 control-label">退休时间：</label>
								<div class="col-sm-8">
									<input id="retireDate" name="retireDate" class="form-control" type="text">
								</div>
							</div> -->
							<div class="form-group">
								<label class="col-sm-3 control-label">合同图片：</label>
								<div class="col-sm-8">
									<input type="hidden" id="fileId" name="fileId" value="0" >
									<img id="showImg" src="/img/backg01.jpg" style="width: 100%;cursor: pointer;" >
									<input  type="file" class="hidden" id="file" name="file" onchange="uploadFile(this.files)" />
								</div>
								<script type="text/javascript">
                                    $("#showImg").click(function () {
                                        $("#file").click();
                                    });

                                    function uploadFile(files) {

                                        var type = files[0].type;
                                        if(type.indexOf("image") < 0){
                                            layer.msg('请上传图片格式...', {
                                                icon: 2
                                            });
                                            return false;
                                        }
                                        var size = files[0].size;
                                        if ((size / 1024 / 1024) > 2) {
                                            layer.msg('图片大小不能超过2M...', {
                                                icon: 2
                                            });
                                            return false;
                                        }
                                        console.log("size=" + size);
                                        var formData = new FormData();
                                        formData.append("file", files[0]);
                                        $.ajax({
                                            data: formData,
                                            type: "POST",
                                            url: "/common/sysFile/upload",    // 图片上传出来的url，返回的是图片上传后的路径，http格式
                                            cache: false,
                                            contentType: false,
                                            processData: false,
                                            dataType: "json",
                                            success: function (data) {//data是返回的hash,key之类的值，key是定义的文件名
                                                $("#showImg").attr("src", data.fileName);
                                                $("#fileId").val(data.sysFileId);
                                            },
                                            error: function () {
                                                layer.msg('上传失败', {
                                                    icon: 2
                                                });
                                            }
                                        });
                                    }
								</script>
							</div>
											
														<div class="form-group">	
								<label class="col-sm-3 control-label">备注：</label>
								<div class="col-sm-8">
									<input id="pactRemark" name="pactRemark" class="form-control" type="text">
								</div>
							</div>
											<!-- 			<div class="form-group">	
								<label class="col-sm-3 control-label">退休状态（1为未退休，2为退休）：</label>
								<div class="col-sm-8">
									<input id="retirement" name="retirement" class="form-control" type="text">
								</div>
							</div> -->
																					<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	</div>
	<div  id="show2" style="display:none">
	<div class="wrapper wrapper-content ">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-left">
							<button  type="button" class="btn  btn-primary"
								onclick="updateTrue()">
								<i class="fa fa-plus" aria-hidden="true"></i>选择
							</button>
						</div>
						<div class="columns pull-right">
							<button class="btn btn-success" onclick="reLoad()">查询</button>
						</div>
						<div class="columns pull-right col-md-2 nopadding">
							<input id="searchName" type="text" class="form-control"
								placeholder="">
						</div>
					</div>
					<table id="exampleTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
		</div>

	
	<!--shiro控制bootstraptable行内按钮看见性 来自bootdo的创新方案 -->
		<div>
			<script type="text/javascript">
				var s_edit_h = 'hidden';
				var s_remove_h = 'hidden';
				var s_resetPwd_h = 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="phry:pact:edit">
			<script type="text/javascript">
				s_edit_h = '';
			</script>
		</div>
		<div shiro:hasPermission="phry:pact:remove">
			<script type="text/javascript">
				var s_remove_h = '';
			</script>
		</div>
		<div shiro:hasPermission="phry:pact:resetPwd">
			<script type="text/javascript">
				var s_resetPwd_h = '';
			</script>
		</div>
	</div>
	
	
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/phry/pact/pact_expire/add.js">
	</script>
	<script>
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            //执行一个laydate实例
            laydate.render({
                elem: '#dateBirth',
                type: 'date',
                range: false,
                format: 'yyyy-M-d'
            });
            laydate.render({
                elem: '#dateSigning',
                type: 'date',
                range: false,
                format: 'yyyy-M-d'
            });
            laydate.render({
                elem: '#probationPeriod',
                type: 'date',
                range: false,
                format: 'yyyy-M-d'
            });
            laydate.render({
                elem: '#expirationTime',
                type: 'date',
                range: false,
                format: 'yyyy-M-d'
            });
        })
	</script>
</body>
</html>
